<div class="footer">
    <div class="wrap clearfix">
        <div class="left">
            <h2>希望之路</h2>
            <p>我们除了丰富知识，还有很多东西值得分享</p>
            <div class="line">
            </div>
            <div class="phone clearfix">
                <i class="iconfont">&#xe60b;</i>
                <span>4009606771<br/>0551—63456171</span>
            </div>
            <div class="address">
                公司地址：安徽合肥蜀山区中国科学技术大学 东区 364号楼
            </div>
        </div>
        <div class="right">
            <span class="focus clearfix"><i class="iconfont">&#xe60a;</i><em>关注超老师</em></span>
            <img src="../common/resource/qrcode.jpg" alt="">
            <p>获取最新动态</p>
        </div>
    </div>
    <p class="info">© 2015-2015 chaolaoshi.com 版权所有 皖ICP备15026401号-1</p>
</div>
<div class="modal fade" id="FastFindModal" tabindex="-1" role="dialog" aria-labelledby="FastFindModalLabel" aria-hidden="true" style="color:#333;">
    <div class="modal-dialog text-center">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="FastFindModalLabel">请填写相关信息</h4>
            </div>

            <div class="modal-body">
                <div class="login-form" ng-controller="FastOrderCtrl">
                    <form>
                        <div class="row">
                            <div class="col-md-3 col-xs-12">
                            </div>
                            <div class="col-md-12 col-xs-12">
                                <div class="form-group clearfix">
                                    <label class="control-label left" for="phone">
                                        姓名
                                    </label>
                                    <input type="name" class="form-control login-field long_name" value="" placeholder="请输入姓名" id="phone" name="name" required="">
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label left" for="cellphone">手机</label>
                            <input class="form-control login-field long_cellphone" type="text" placeholder="请输入手机号码" id="cellphone" name="cellphone" required="">
                        </div>
                        <div class="form-group clearfix" >
                            <label class="control-label left" for="subject" style=" line-height:47px;">年级</label>
                            <select name="grade" id="grade">
                                <option value="" selected>请选择年级</option>
                                <option value="1">一年级</option>
                                <option value="2">二年级</option>
                                <option value="3">三年级</option>
                                <option value="4">四年级</option>
                                <option value="5">五年级</option>
                                <option value="6">六年级</option>
                                <option value="7">七年级</option>
                                <option value="8">八年级</option>
                                <option value="9">九年级</option>
                                <option value="10">高一</option>
                                <option value="11">高二</option>
                                <option value="12">高三</option>
                            </select>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label left" for="lesson">科目</label>
                            <input class="form-control login-field" type="text" placeholder="请输入科目" id="lesson" name="lesson" required="">
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label left" for="time">时间</label>
                            <input class="form-control login-field long_time" type="text" placeholder="请输入您预约时间，例：2016-01-01" id="time" name="time" required="">
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label left" for="location">地址</label>
                            <input class="form-control login-field  long_address"  type="text" placeholder="请输入您的家庭地址" id="location" name="address" required="">
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label left" for="desc">备注</label>
                            <textarea class="form-control login-field  long_remarks" type="text" placeholder="您可以留言备注信息哦" id="desc" name="remarks" rows="3"></textarea>
                        </div>

                        <a href="javascript:;" class="btn btn-primary long-btn kkk_click  " data-dismiss="modal" type="submit">提交预约</a>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div> <!-- modal ENDS -->


<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

<script>
    $('.fastparentOrder').on('click', function(){
        var id = '0';
        dataid = '';
        $('#FastFindModal').show().addClass('in');
    });

    // 提交预约
    $('.kkk_click').click(function(){
        var name =  $('.long_name').val();
        var cellphone =  $('.long_cellphone').val();
        var grade =  $('[name=grade]').val();
        var lesson = $('[name=lesson]').val();
        var time =  $('.long_time').val();
        var address =  $('.long_address').val();
        var remarks =  $('.long_remarks').val();
        var coursenum = $('[name=coursenum]').val();
        if (!/^[\u4e00-\u9fa5]{2,4}$/.test(name)){
            alert('请填写学生姓名');
            return false;
        }
        if (!/^1\d{10}$/.test(cellphone)){
            alert('手机号码格式不正确');
            return false;
        }
        if (grade==""){
            alert('请填写年级和科目');
            return false;
        }
        if (lesson== '') {
            alert('请填写科目');
            return false;
        }
        if( time==""){
            alert('请填写期望时间');
            return false;
        }
        if (coursenum === '') {
            alert('请填写课程时间');
            return false;
        }
        if(!/^[\u4e00-\u9fa5]+$/.test(address)){
            alert('请填写地址');
            return false;
        }
        if( remarks==""){
            alert('请填写备注');
            return false;
        }
        $.ajax({
            type:"post",
            url: dataid ? "/Home/Index/parentOrder" : "/Home/Index/fastparentOrder",
            dataType:"json",
            data:{
                teacher_id: dataid,
                cellphone:cellphone,
                grade:grade,
                name:name,
                time:time,
                address:address,
                remarks:remarks,
                lesson: lesson
            },
            success: function(result) {
                if ( result.flag == 1) {
                    alert(result.content);
                    location.reload();
                    //$('#FastFindModal').hide().removeClass('in');
                } else{
                    alert(result.content);
                    location.reload();
                    //$('#FastFindModal').hide().removeClass('in');
                }
            }
        });
    });
    // 关闭语言浮层
    $('.close').click(function(){
        $('#FastFindModal').hide().removeClass('in');
    });
</script>
